using System.Collections.Generic;
using UnityEngine;

public class AllVehicleDestroyEvents : MonoBehaviour
{
	public static AllVehicleDestroyEvents instance;

	[Header("City Vehicle Destroy")]
	public VehicleDestroyEvent CityVehicleDestroy;

	public TimedVehicleDestroyEvent CityVehicleCRASH;

	public TimedVehicleDestroyEvent CityVehicleDestruction;

	public TimedVehicleDestroyEvent CityVehicleApocalypse;

	[Header("Private Car Destroy")]
	public VehicleDestroyEvent PrivatCarDestroy;

	public TimedVehicleDestroyEvent PrivateCarDestruction;

	public TimedVehicleDestroyEvent PrivateCarApocalypse;

	public TimedVehicleDestroyEvent PrivateCarPyromaniac;

	[Header("Private Tank Destroy")]
	public VehicleDestroyEvent PrivatTankDestroy;

	public TimedVehicleDestroyEvent PrivateTankDestruction;

	public TimedVehicleDestroyEvent PrivateTankApocalypsev;

	private void Awake()
	{
		instance = this;
	}

	public void CheckAllEvents(VehicleDestroyInfo newVehicleDestroy, List<VehicleDestroyInfo> vehicleDestroyList)
	{
		if (CityVehicleDestroy.IfEvent(newVehicleDestroy))
		{
			GameplayRewardManager.instance.AddToRewardQueue(CityVehicleDestroy);
		}
		if (CityVehicleCRASH.IfEvent(newVehicleDestroy, vehicleDestroyList))
		{
			GameplayRewardManager.instance.AddToRewardQueue(CityVehicleCRASH);
			StartCoroutine(CityVehicleCRASH.DisableForTime());
		}
		if (PrivatCarDestroy.IfEvent(newVehicleDestroy))
		{
			GameplayRewardManager.instance.AddToRewardQueue(PrivatCarDestroy);
		}
		if (PrivateCarDestruction.IfEvent(newVehicleDestroy, vehicleDestroyList))
		{
			GameplayRewardManager.instance.AddToRewardQueue(PrivateCarDestruction);
			StartCoroutine(PrivateCarDestruction.DisableForTime());
		}
		if (PrivatTankDestroy.IfEvent(newVehicleDestroy))
		{
			GameplayRewardManager.instance.AddToRewardQueue(PrivatTankDestroy);
		}
		if (PrivateTankDestruction.IfEvent(newVehicleDestroy, vehicleDestroyList))
		{
			GameplayRewardManager.instance.AddToRewardQueue(PrivateTankDestruction);
			StartCoroutine(PrivateTankDestruction.DisableForTime());
		}
		GameplayRewardManager.instance.TryShowMessage();
	}
}
